package com.example.Laboratory.Service.Impl;

import com.example.Laboratory.Entity.Achievements_patent;
import com.example.Laboratory.Mapper.Achievements_patentMapper;
import com.example.Laboratory.Service.Achievements_patentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class Achievements_patentServiceImpl implements Achievements_patentService {

    @Autowired
    Achievements_patentMapper achievements_patentMapper;

    //增加科研成果-专利信息
    @Override
    public String addAchievements_patent(Achievements_patent p) {
        if (achievements_patentMapper.addAchievements_patent(p) == 1) {
            return "添加成功";
        } else {
            return "添加失败";
        }
    }

    //根据id删除信息
    @Override
    public String deleteAchievements_patent(int achievements_patent_id) {
        if (achievements_patentMapper.deleteAchievements_patent(achievements_patent_id) == 1) {
            return "删除成功";
        } else {
            return "删除失败";
        }
    }

    //查找全表信息
    @Override
    public List<Achievements_patent> researchAchievements_patent() {
        return achievements_patentMapper.researchAchievements_patent();
    }

    //修改信息
    @Override
    public String reviseAchievements_patent(Achievements_patent p) {
        if (achievements_patentMapper.reviseAchievements_patent(p) == 1) {
            return "修改成功";
        } else {
            return "修改失败";
        }
    }
}
